<template>
	<div class="oncallbox">
		<div class="equipment_tit">{{phone}}
			<div class="oncallmesgbox">
				<!-- <span>23:02-前假数据</span> -->
				<a @click="handleMute">静音</a>
				<a @click="handleTransfer">转接</a>
				<a @click="handleHang">挂机</a>
			</div>
		</div>
		<div class="equipment_mesg clearfix">
			<div class="equipment_flbox">
				<div class="equipment_serchbox">
					<el-input
					  placeholder="请输入地址或电话号码"
					  v-model="searchHouseMesg"
					  clearable>
            <el-button slot="append" icon="el-icon-search" @click='searchBtn'></el-button>
					</el-input>
					
				</div>
				<div class="clearfix" v-loading="loading">
					<div class="searcop_list" v-for="(companyName,index) in companyNames" key="index" @click="chooseHouseMesgBtn(companyName,index)">{{companyName.address}}</div>
				</div>
			</div>
			<div class="equipment_frbox">
				<el-tabs v-model="activeName" @tab-click="handleClick">
				    <el-tab-pane label="设备运行" name="first">

					<div class="equiRunBox"v-for="item in runDeviceList" key="index" v-if="showSbidRun">
						<div class="equiRunHead" >
							<div class="equiRunHeadText">
								<span :class="classObject(item.yxzt)" v-if="item.yxzt==''? false : true">{{item.yxzt}}</span>
								<a style="font-size: 10px;" @click="lookDevHistory(item.sb_id)">
									{{item.gsjc}}{{item.sblxmc}}{{item.sbxh}}
									<span style="font-size: 12px;cursor:pointer;">详情 》</span>
								</a>
							</div>
							<a class="newFastOrder" @click="handleAddorder">新增工单 》</a>
						</div>
						<div style="width: 100%;margin-top:10px;">
							<ul class="runDeviceUl">
								<li class="runDeviceli" v-if="item.sdwd==''? false : true">
									<img src="../../../static/image/before.png" class="runImages">
									<div class="runDeviceItem">
										<p style="runDeviceText">{{item.sdwd}}</p>
										<p class="runDeviceHeader">设定温度</p>
									</div>
								</li>
								<li class="runDeviceli" v-if="item.yxms==''? false : true">
									<img src="../../../static/image/before.png" class="runImages">
									<div class="runDeviceItem">
										<p style="runDeviceText">{{item.yxms}}</p>
										<p class="runDeviceHeader">运行模式</p>
									</div>
								</li>
								<li class="runDeviceli" v-if="item.jswd==''? false : true">
									<img src="../../../static/image/before.png" class="runImages">
									<div class="runDeviceItem">
										<p style="runDeviceText">{{item.jswd}}</p>
										<p class="runDeviceHeader">进水温度</p>
									</div>
								</li>
								<li class="runDeviceli" v-if="item.cswd==''? false : true">
									<img src="../../../static/image/before.png" class="runImages">
									<div class="runDeviceItem">
										<p style="runDeviceText">{{item.cswd}}</p>
										<p class="runDeviceHeader">出水温度</p>
									</div>
								</li>
								<li class="runDeviceli" v-if="item.snwd==''? false : true">
									<img src="../../../static/image/before.png" class="runImages">
									<div class="runDeviceItem">
										<p style="runDeviceText">{{item.snwd}}</p>
										<p class="runDeviceHeader">室内温度</p>
									</div>
								</li>
								<li class="runDeviceli" v-if="item.swwd==''? false : true">
									<img src="../../../static/image/before.png" class="runImages">
									<div class="runDeviceItem">
										<p style="runDeviceText">{{item.swwd}}</p>
										<p class="runDeviceHeader">室外温度</p>
									</div>
								</li>
								<li class="runDeviceli" v-if="item.sbzt==''? false : true">
									<img src="../../../static/image/before.png" class="runImages">
									<div class="runDeviceItem">
										<p style="runDeviceText">{{item.sbzt}}</p>
										<p class="runDeviceHeader">设备状态</p>
									</div>
								</li>
								<li class="runDeviceli" v-if="item.sbgzm==''? false : true">
									<img src="../../../static/image/before.png" class="runImages">
									<div class="runDeviceItem">
										<p style="runDeviceText">{{item.sbgzm}}</p>
										<p class="runDeviceHeader">设备故障码</p>
									</div>
								</li>
								<li class="runDeviceli" v-if="item.sbgzqk==''? false : true">
									<img src="../../../static/image/before.png" class="runImages">
									<div class="runDeviceItem">
										<p style="runDeviceText">{{item.sbgzqk}}</p>
										<p class="runDeviceHeader">设备故障情况</p>
									</div>
								</li>

							</ul>
							<div style="width: 200px;height: 20px;margin-bottom:10px;margin-left:17px;" v-if="item.cjsj==''? false : true">
								<p style="font-size:10px;color:rgba(102,102,102,1);">采集时间:{{item.cjsj}}</p>
							</div>
						</div>
						<div class="nomesg" v-if="item.yxzt==''? true : false">暂无设备运行相关数据</div>
					</div>
					<div class="nomesg" v-if="showSbidBox">暂无相关设备</div>
					

				    </el-tab-pane>
				    <el-tab-pane label="信息管理" name="second">
						<!-- 房屋内容 -->
						<p class="oncall_adrstit">{{roomForm.address}}</p>
						<el-form :model="roomForm" :rules="roomrules" ref="roomForm" label-width="100px" class="oncall_mesgbox clearfix">
						  
						  <el-form-item label="房屋地址" prop="areaadrslist" class="width100">
						    <el-cascader
							    :options="areaadrs"
									:change-on-select="true"
							    v-model="areaadrslist"
							    @change="areaChoose">
							  </el-cascader>
						  </el-form-item>

						  <el-form-item label="详细地址"  class="width100" prop='address'>
						    <el-input v-model="roomForm.address"></el-input>
						  </el-form-item>
						  <el-form-item label="建筑面积" prop='structureArea'>
						    <el-input type="text" v-model="roomForm.structureArea">
						    	<template slot="append">㎡</template>
						    </el-input>
						    
						  </el-form-item>
						  <el-form-item label="采暖面积" prop="heatingArea">
						    <el-input type="text" v-model="roomForm.heatingArea">
						    	<template slot="append">㎡</template>
						    </el-input>
						    
						  </el-form-item>
						   <el-form-item label="建筑结构" prop="buildingStructureName" >
						    <el-select v-model="buildingStructureName" placeholder="请选择建筑结构" >
						     	<el-option 
						      		v-for="item in roomForm.buildingStructure"
									:key="item.paramValue"
									:label="item.paramName"
									:value="item.paramValue"></el-option>
						    </el-select>
						  </el-form-item>
						  <el-form-item label="建筑层高" prop="build">
						    <el-input type="text" v-model="roomForm.build">
						    	<template slot="append">m</template>
						    </el-input>
						    
						  </el-form-item>
						  <el-form-item label="外墙厚度" prop="wallThickness">
						    <el-input type="text" v-model="roomForm.wallThickness">
						    	<template slot="append">cm</template>
						    </el-input>
						    
						  </el-form-item>
						  <el-form-item label="外墙保温" prop="wallKeepWarmName">
						    <el-select v-model="wallKeepWarmName" placeholder="请选择外墙保温">
						      <el-option 
						      		v-for="item in roomForm.wallKeepWarm"
									:key="item.paramValue"
									:label="item.paramName"
									:value="item.paramValue"></el-option>
						    </el-select>
						  </el-form-item>
						  <el-form-item label="采暖末端" prop="heatingTerminalName">
						    <el-select v-model="heatingTerminalName" placeholder="请选择外墙保温">
						      <el-option 
						      		v-for="item in roomForm.heatingTerminal"
									:key="item.paramValue"
									:label="item.paramName"
									:value="item.paramValue"></el-option>
						    </el-select>
						  </el-form-item>
						  <el-form-item label="供暖方式" prop="heatingModeName">
						    <el-select v-model="heatingModeName" placeholder="请选择外墙保温">
						      <el-option 
						      		v-for="item in roomForm.heatingMode"
									:key="item.paramValue"
									:label="item.paramName"
									:value="item.paramValue"></el-option>
						    </el-select>
						  </el-form-item>

						  <div class="clearboth">用户信息</div>
						  <el-form  :model="roomForm1" ref="roomForm1" label-width="100px">
							  <el-form-item label="姓名" prop="clientName">
							    <el-input type="text" v-model="roomForm1.clientName"></el-input>
							  </el-form-item>
							  
							  <el-form-item label="性别">
							    <el-radio-group v-model="roomForm1.sex">
							      <el-radio label="0">男</el-radio>
							      <el-radio label="1">女</el-radio>
							    </el-radio-group>
							  </el-form-item>
							   <el-form-item label="身份证号" prop="idCard">
							    <el-input type="text" v-model="roomForm1.idCard"></el-input>
							  </el-form-item>
						  </el-form>
						   <el-form-item class="width100"><p class="oncall_tips">请确认客户信息以及房屋信息,点击保存进行下一步操作</p></el-form-item>
						  <el-form-item class="width100">
						    <el-button type="primary" @click="saveHouseBtn('roomForm')">保存</el-button>
						    <el-button type="info" @click="resetForm">重置取消</el-button>
							<el-button @click="resetForm">取消</el-button>
						  </el-form-item>
						</el-form>
						<!-- gm下面表格tabsgm -->
						<!-- gm房屋信息详情-accordion添加实现手风琴效果gm -->
						<div class="tabs_box">
							<el-collapse v-model="tabsNames">
								<el-collapse-item name="客户信息">
									<template slot="title">
								      <div class="tabs_headtit">客户信息</div>
								    </template>
								    <div class="">
								    	<el-table
									        :data="customerMesgTable"
									        stripe
									        border
									        style="width: 100%">
									        <el-table-column
									          type='index'
									          label="序号"
									          align='center'
									          width="50">
									        </el-table-column>
									        <el-table-column
									          prop="clientName"
									          label="姓名"
									          width="120">
									        </el-table-column>
									        <el-table-column
									          prop="sexName"
									          label="性别"
									          width="60">
									        </el-table-column>
									        <el-table-column
									          prop="phone"
									          label="电话号码" 
									          width="120">
									        </el-table-column>
									        <el-table-column
									          prop="idcardReal"
									          label="身份证号"
									          width="180">
									        </el-table-column>
									         <el-table-column
									          prop="communicationRecordCount"
									          label="沟通记录">
									        </el-table-column>
											<el-table-column
									          fixed='right'
									          width="60"
									          align='center'
									          label="操作">
									            <template slot-scope="scope">
									              <el-button
									                size="mini"
									                type="danger"
									                @click="deteleClienteleBtn(scope.$index, scope.row)">删除</el-button>
									             
									          
									            </template>
									        </el-table-column>
									       
									      </el-table>

								    </div>
								</el-collapse-item>
								<el-collapse-item name="设备信息">
								    <template slot="title">
								      <div class="tabs_headtit">设备信息
								      	<el-button 
								      	class="oncall_addnew"
								      	size="mini"
								      	@click="equiChangeBtn"
								      	icon="el-icon-circle-plus-outline"></el-button>
								      </div>
								    </template>
								    <div class="">
								    	<el-table
									        :data="equiTable"
									        stripe
									        border
									        style="width: 100%">
									        <el-table-column
									          type='index'
									          label="序号"
									          align='center'
									          width="50">
									        </el-table-column>
									        
									        <el-table-column
									          prop="classes"
									          label="设备类别"
									          min-width="200">
									        </el-table-column>
									        <el-table-column
									          prop="model"
									          label="设备型号"
									          min-width="200">
									        </el-table-column>
									        <el-table-column
									          prop="equipmentCompanyName"
									          label="设备品牌"
									          min-width="200">
									        </el-table-column>
									        <el-table-column
									          prop="equipmentNumber"
									          label="设备序列号"
									          min-width="180">
									        </el-table-column>
									         <el-table-column
									          prop="transmitNumber"
									          label="设备传输号"
									          min-width="180">
									        </el-table-column>
									        <el-table-column
									          prop="installationSite"
									          label="机组安装位置"
									          width="110">
									        </el-table-column>
									      	<el-table-column
									          fixed='right'
									          width="120"
									          align='center'
									          label="操作">
									            <template slot-scope="scope">
									              <el-button
									                size="mini"
									                type="primary"
									                @click="equiChangeBtn(scope.$index, scope.row)">编辑</el-button>
									             <el-button
									                size="mini"
									                type="danger"
									                @click="deteleEquiBtn(scope.$index, scope.row)">删除</el-button>
									          
									            </template>
									        </el-table-column>
									       
									      </el-table>

								    </div>
								</el-collapse-item>
								<!-- wss修改过的部分wss -->
								<el-collapse-item name="工单信息">
									<template slot="title">
								      <div class="tabs_headtit">工单信息
								      	<el-button 
								      	class="oncall_addnew"
								      	 size="mini"
								      	 @click="handleAddorder"
								      	 icon="el-icon-circle-plus-outline"></el-button>
								      </div>
								    </template>
								    <div class="">
								    	<el-table
									        :data="customerTable"
									        stripe
									        border
									        style="width: 100%">
									        <el-table-column
									          type='index'
									          label="序号"
									          align='center'
									          width="50">
									        </el-table-column>
									        <el-table-column
									          prop="statusName"
									          label="状态"
									          width="100">
									        </el-table-column>
									        <el-table-column
									          prop="workTypeName"
									          label="任务类型"
									          width="120">
									        </el-table-column>
									        
									        <el-table-column
									          prop="emergencyDegreeName"
									          label="紧急程度"
									          width="100">
									        </el-table-column>
									         <el-table-column
									          prop="gmtCreate"
									          label="创建时间" 
									          width="180">
									        </el-table-column>

									        <el-table-column
									          prop="workOrderDesc"
									          label="任务描述" 
									          min-width="180">
									        </el-table-column>
									      	<el-table-column
									          fixed='right'
									          width="60"
									          align='center'
									          label="操作">
									            <template slot-scope="scope">
									              <el-button
									                size="mini"
									                type="primary"
									                @click="handleLookorder(scope.$index, scope.row)">查看</el-button>
									          
									            </template>
									        </el-table-column>
									       
									      </el-table>

									      
									      <div class="block">
														<el-pagination
															@size-change="handleSizeChangeWorkOrder"
															@current-change="handleCurrentChangeWorkOrder"
															:current-page.sync="currentPageWorkOrder"
															:page-sizes="[5, 10, 20, 30]"
															:page-size="pageSizeWorkOrder"
															layout="sizes, prev, pager, next"
															:total="totalWorkOrder">
														</el-pagination>
													</div>
								    </div>
								</el-collapse-item>
								<el-collapse-item name="沟通记录">
									<template slot="title">
								      <div class="tabs_headtit">沟通记录
								      	<el-button 
								      	class="oncall_addnew"
								      	 size="mini"
								      	 @click="handleAddcommuni"
								      	 icon="el-icon-circle-plus-outline"></el-button>
								      </div>
								    </template>
								    <div class="">
								    	<el-table
									        :data="communicationTable"
									        stripe
									        border
									        style="width: 100%">
									        <el-table-column
									          type='index'
									          label="序号"
									          align='center'
									          width="50">
									        </el-table-column>
									        <el-table-column
									          prop="communicationTypeName"
									          label="沟通类别"
									          width="120">
									        </el-table-column>
									        <el-table-column
									          prop="gmtCreate"
									          label="沟通时间"
									          width="120">
									        </el-table-column>
									        <el-table-column
									          prop="desc"
									          label="沟通内容"
									          min-width='200'>
									        </el-table-column>
									      	
									       	<el-table-column
									          fixed='right'
									          width="60"
									          align='center'
									          label="操作">
									            <template slot-scope="scope">
									              <el-button
									                size="mini"
									                type="primary"
									                @click="handleLookcommunication(scope.$index, scope.row)">查看</el-button>
									          
									            </template>
									        </el-table-column>

									      </el-table>

									      
									      <div class="block">
													<el-pagination
														@size-change="handleSizeChange"
														@current-change="handleCurrentChange"
														:current-page.sync="currentPageCommunication"
														:page-sizes="[5, 10, 20, 30]"
														:page-size="pageSizeCommunication"
														layout="sizes, prev, pager, next"
														:total="totalCommunication">
													</el-pagination>
												</div>
								    </div>
								</el-collapse-item>

							</el-collapse>
						</div>

					</el-tab-pane>
				    
				</el-tabs>
				<!-- gm-end-gm -->
			</div>
		</div>
		<!-- gmdialoggm -->
		<!-- gm确认删除gm -->
	    <el-dialog title="确认删除" :visible.sync="dialogdele" center width='400px' :close-on-click-modal="false">
	      <div class="dialogall_ctext">
	        <i class="el-icon-warning"></i>是否确认删除？
	      </div>
	      <el-input v-model="sureDeteleId" type="hidden"></el-input>
	      <div slot="footer" class="dialog-footer">
	        <el-button @click="dialogdele = false">取 消</el-button>
	        <el-button type="primary" @click="onDetele">确 定</el-button>
	      </div>
	    </el-dialog>
	    
	     <!-- gm添加设备gm -->
	    <el-dialog :title='title' :visible.sync="dialogaddequi" center width='600px' :close-on-click-modal="false">
	      <div class="dialogall_ctext">
	        <el-form :model="equiaddForm"  ref="equiaddForm" label-width="100px" class="oncall_mesgbox oncall_equimesg clearfix">
				 
				  <el-form-item label="设备类型" >
				     <el-select v-model="classesNameLabel" placeholder="请选择设备类型" @change="onSelectedClasses($event, item)">
				      <el-option 
				      		v-for="(item, index) in equiaddForm.classes"
							:key="index"
							:label="item"
							:value="item"></el-option>
				    </el-select>
				  </el-form-item>
				  <el-form-item label="设备品牌" >
				     <el-select v-model="equipmentCompanyNameLabel" placeholder="请选择设备品牌" @change="onSelectedModel($event, item)">
				      <el-option 
				      		v-for="(item,index) in equiaddForm.model"
							:key="index"
							:label="item.trademarksName"
							:value="item.trademarksId"></el-option>
				    </el-select>
				  </el-form-item>
				  <el-form-item label="设备型号">
				     <el-select v-model="modelNameLabel" placeholder="请选择设备型号" @change='onSelectedEquiId($event, item)'>
				      <el-option 
				      		v-for="(item,index) in equiaddForm.equipmentCompanyName"
							:key="index"
							:label="item.modelName"
							:value="item.modelId"></el-option>
				    </el-select>
				  </el-form-item>
				  <el-form-item label="设备序列号" prop="equipmentNumber">
				    <el-input v-model="equiaddForm.equipmentNumber"></el-input>
				  </el-form-item>

				  <el-form-item label="传输序列号" prop="transmitNumber">
				    <el-input v-model="equiaddForm.transmitNumber"></el-input>
				  </el-form-item>
			</el-form>

	      </div>
	      <div slot="footer" class="dialog-footer">
	        <el-button @click="dialogaddequi = false">取 消</el-button>
	        <el-button type="primary" @click="onEquiSave">确 定</el-button>
	      </div>
	    </el-dialog>

	    <!-- gm选择转接分机==数据完成gm -->
	    <el-dialog title="选择转接分机" :visible.sync="dialogTransfer" center width='400px' :close-on-click-modal="false">
	      <div class="dialogall_ctext">
	        <el-form label-width="100px" class="oncall_mesgbox clearfix">
				  <el-form-item label="选择分机">
				     <el-select v-model='phoneListShow' key="phoneList" default-first-option placeholder="分机号码">
					    	<el-option 
					    	v-for="item in phoneList" 
					    	:key="item" 
					    	:label="item" 
					    	:value="item"
					    	:disabled="item.disabled">
					    	</el-option>
					    </el-select>
				  </el-form-item>

			</el-form>

	      </div>
	      <div slot="footer" class="dialog-footer">
	        <el-button @click="dialogTransfer = false">取 消</el-button>
	        <el-button type="primary" @click="okTransferBtn">确 定</el-button>
	      </div>
	    </el-dialog>
	    <!-- gm设备运行情况弹窗gm -->
	    <el-dialog  title="设备运行历史情况" :visible.sync="dialogDevHistory" center width='800px' :close-on-click-modal="false">
	    	<div style="height: 450px; overflow: auto;">
				<div class="dialogall_ctext">
	        	<!-- v-loading="loading" 表格中需要加的 -->
			    <el-table
			      	ref='equiHisTableDataRefs'
			        :data="equiHisTableData"
			        stripe
			        border
			        style="width: 100%">
					
		        <el-table-column
		          type='index'
		          label="序号"
		          align='center'
		          width="50">
		        </el-table-column>
		        <template v-for='(colHistory) in equiHisLineTableList' >
		          <el-table-column
		            :prop="colHistory.dataItem"
		            :label="colHistory.dataName + colHistory.unit"
		            :key="colHistory.dataItem"
		            min-width="120">
		          </el-table-column>
		        </template>
		      </el-table>
		      <!-- gm数据不多暂时不做分页gm -->
		      <!-- <div class="block">
		        <el-pagination
			        @size-change="handleSizeChangeHistoryEqui"
			        @current-change="handleCurrentChangeHistoryEqui"
			        :current-page.sync="currentPageHistoryEqui"
			        :page-sizes="[5, 10, 20, 30]"
			        :page-size="pageSizeHistoryEqui"
			        layout="sizes, prev, pager, next"
			        :total="totalHistoryEqui">
		        </el-pagination>
		      </div> -->

	      	</div>
		    <div slot="footer" class="dialog-footer" style="display:flex;flex-direction:row;justify-content:center;align-items:center;margin-top:10px;">
		        <el-button type="primary" @click="dialogDevHistory = false">关 闭</el-button>
		    </div>
			</div>
	    </el-dialog>
		<!-- gmdialoggm -->
		<!-- wss-dialog制作部分-wss -->
		 <!-- gm -添加工单-gm-->
	    <el-dialog title="添加工单" :visible.sync="dialogaddorder" center width='800px' :close-on-click-modal="false">
	    	<div class="dialogall_ctext">
					<!-- :rules="orderaddForm" -->
	    		<el-form :model="orderaddForm" :rules="rulesPhone" ref="orderaddForm" label-width="100px" class="oncall_mesgbox clearfix">
				  <el-form-item label="客户姓名">
				    <div>{{clienteleName}}</div>
				  </el-form-item>
				  <el-form-item label="客户电话">
				     <div>{{clientelephone}}</div>
				  </el-form-item>
				  <el-form-item label="联系人姓名">
				    <el-input v-model="orderaddForm.contactName"></el-input>
				  </el-form-item>
					
				  <el-form-item label="联系人电话" prop="contactTelephone">
						<el-input type="text" autocomplete="off" v-model="orderaddForm.contactTelephone"></el-input>
				     <!-- <el-input v-model="orderaddForm.contactTelephone"></el-input> -->
				  </el-form-item>
				  <el-form-item label="任务类型" prop="type">
				    <el-select v-model="workTypeValue" placeholder="请选择任务类型">
				      <el-option
								v-for="item in workTypeSelect"
								:key="item.id"
								:label="item.name"
								:value="item.id">
							</el-option>
				    </el-select>
				  </el-form-item>
				   <el-form-item label="紧急程度" prop="emergencyDegreeValue" class="width100">
						 <el-radio 
						 	v-for="(item, index) in emergencyDegreeSelect" 
						  :key="index"
							:label="item.paramValue"
							v-model="emergencyDegreeValue">{{item.paramName}}</el-radio>
				  </el-form-item>
				  <el-form-item label="维修设备" prop="equi" class="width100 longRadio">
						<el-radio-group v-model="classesMpdelNameValue">
							<el-radio 
								v-for="(item, index) in classesMpdelNameCheckbox" 
								:key="index"
								:label="item.id"
								:checked="checkboxValue">{{item.classesMpdelName}}
							</el-radio>
						</el-radio-group>
				  </el-form-item>		 
				   <el-form-item label="来电记录" prop="desc" class="width100">
				    <el-input type="textarea" v-model="orderaddForm.desc"></el-input>
				  </el-form-item>
				    <el-form-item label="处理人" prop="person">
							<el-select v-model="handelUserValue" placeholder="请选择">
								<el-option
									v-for="item in handelUser"
									:key="item.id"
									:label="item.operationName"
									:value="item.id">
								</el-option>
							</el-select>
						</el-form-item>
					</el-form>
	    	</div>
	    	<div slot="footer" class="dialog-footer">
					<el-button @click="canleWork('orderaddForm')">取消</el-button>
		      <el-button type="primary" @click="submitaddWorkOrderForm('orderaddForm')">提交</el-button> 
	      </div>
	    </el-dialog>	
	    <!-- gm工单查看gm -->
	    <el-dialog title="工单查看" :visible.sync="dialogorderlook" center width='800px' :close-on-click-modal="false" :show-close="false">
	      <div class="dialogall_ctext">
	       	<div class="order_mesg clearfix" >
					<div class="line_list clearfix line100 order_stateline" >
						<span class="line_listtit fl">状态：</span>
						<div class="line_listinput" >
							{{status}}
						</div>
					</div>
					<div class="line_list clearfix " >
						<span class="line_listtit fl">工单类型：</span>
						<div class="line_listinput" >
							{{orderTypeName}}
						</div>
					</div>
					<div class="line_list clearfix" >
						<span class="line_listtit fl">创建人：</span>
						<div class="line_listinput" >
							{{userName}}
						</div>
					</div>

					<div class="line_list clearfix" >
						<span class="line_listtit fl">创建时间：</span>
						<div class="line_listinput" >
							{{gmtCreate}}
						</div>
					</div>

					<div class="line_list clearfix" >
						<span class="line_listtit fl">处理人：</span>
						<div class="line_listinput" >
							{{operationUserName}}
						</div>
					</div>

					<div class="line_list clearfix" >
						<span class="line_listtit fl">处理时间：</span>
						<div class="line_listinput" >
							{{gmtModified}}
						</div>
					</div>

					

					<div class="line_headtips"><span>联系人</span></div>
					<div class="line_list clearfix" >
						<span class="line_listtit fl">联系人姓名：</span>
						<div class="line_listinput" >
							{{contactName}}
						</div>
					</div>

					<div class="line_list clearfix" >
						<span class="line_listtit fl">联系人电话：</span>
						<div class="line_listinput" >
							{{contactPhone}}
						</div>
					</div>

					<div class="line_headtips"><span>房屋信息</span></div>
					<div class="line_list clearfix line100" >
						<span class="line_listtit fl">房屋地址：</span>
						<div class="line_listinput" >
							{{address}}
						</div>
					</div>

					<div>
						<div class="line_list clearfix line100" v-if="show">
							<span class="line_listtit fl">设备信息：</span>
							<div class="line_listinput" >
								{{equipmentInfoDtos[0].classes}}
							</div>
						</div>
						<div class="line_list clearfix line100" v-else>
							<span class="line_listtit fl">设备信息：</span>
							<div class="line_listinput">{{equipmentInfoDtos}}</div>
						</div>
					</div>

					<div class="line_headtips"><span>任务信息</span></div>
					<div class="line_list clearfix" >
						<span class="line_listtit fl">紧急程度：</span>
						<div class="line_listinput" >
							{{emergencyDegree}}
						</div>
					</div>

					<div class="line_list clearfix" >
						<span class="line_listtit fl">任务类型：</span>
						<div class="line_listinput" >
							{{workTypeDesc}}
						</div>
					</div>
					<div class="line_list clearfix line100" >
						<span class="line_listtit fl">任务描述：</span>
						<div class="line_listinput" >
							{{desc}}
						</div>
					</div>
					<div class="line_headtips"><span>工单跟进记录</span></div>
					<div class="orderrecordlist" v-for="(item,index) in recordlist" :key="index">
						<p class="order_timetit">{{item.gmtCreate}}</p>
						<p class="order_persontit">{{item.post}} {{item.name}}</p>
						<p>{{item.desc}}</p>
					</div>
				</div>

	      </div>
	      <div slot="footer" class="dialog-footer">
	        <el-button @click="dialogorderlook = false">取 消</el-button>
	        <el-button type="primary" @click="dialogorderlook = false">确 定</el-button>
	      </div>
	    </el-dialog>
	    <!-- gm添加沟通gm -->
	    <el-dialog title="添加沟通记录" :visible.sync="dialogaddcommuni" center width='400px' :close-on-click-modal="false" :show-close="false">
	      <div class="dialogall_ctext">
					<!-- :rules="communiaddrules" -->
	        <el-form :model="communiaddForm"  ref="communiaddForm" label-width="100px" class="oncall_mesgbox clearfix">
				 
				  <el-form-item label="沟通类型" prop="type">
				     <el-select v-model="communicationValue" placeholder="请选择沟通类型">
							 <el-option
									v-for="item in communicationTypeSelect"
									:key="item.id"
									:label="item.name"
									:value="item.id">
								</el-option>
				    </el-select>
				  </el-form-item>


				  <el-form-item label="沟通内容" prop="desc">
				    <el-input type="textarea" v-model="communiaddForm.desc"></el-input>
				  </el-form-item>
			</el-form>

	      </div>
	      <div slot="footer" class="dialog-footer">
	        <el-button @click="dialogaddcommuni = false">取 消</el-button>
	        <el-button type="primary" @click="submitaddcommuniForm('communiaddForm')">确 定</el-button>
	      </div>
	    </el-dialog>
	     <!-- gm查看沟通gm -->
	    <el-dialog title="沟通记录" :visible.sync="dialogaddcommunilook" center width='500px' :close-on-click-modal="false" :show-close="false">
	      <div class="dialogall_ctext">
	       		<div class="order_mesg clearfix" >
					<div class="line_list clearfix" >
						<span class="line_listtit fl">沟通类型：</span>
						<div class="line_listinput" >
							{{communicationTypeName}}
						</div>
					</div>
					
					<div class="line_list clearfix" >
						<span class="line_listtit fl">记录人：</span>
						<div class="line_listinput" >
							{{userName}}
						</div>
					</div>
					<div class="line_list clearfix" >
						<span class="line_listtit fl">记录时间：</span>
						<div class="line_listinput" >
							{{gmtCreate}}
						</div>
					</div>
					<div class="line_list clearfix" style="width:100%;">
						<span class="line_listtit fl">沟通内容：</span>
						<div class="line_listinput" >
							{{desc}}
						</div>
					</div>
				</div>

	      </div>
	      <div slot="footer" class="dialog-footer">
	        <el-button @click="dialogaddcommunilook = false">取 消</el-button>
	        <el-button type="primary" @click="dialogaddcommunilook = false">确 定</el-button>
	      </div>
	    </el-dialog>
	    <!-- wss-dialog部分-wss -->

	</div>
</template>
<script>
import {
	pbxUserServiceHang, 
	pxbPhoneMute,
    pbxUserPhoneList,
	pbxUserServiceControl,
	popUpHouseList,
	popChooseHouseMesg, 
	popChooseHouseClienteleMesg,
	getCustomerList,
	getDeviceList,
	popDeteleClienteleMesg, 
	popDeteleDeviceMesg,
	getEquipmentClasses,
	getTrademarks,
	getEquiModels, 
	saveOrModifyDevice,
	saveHouse,
	getXzqhInfo,
	getTaskTypes, //wss-add
	getBusinessPersonnelList,
	getWorkOrder,
	getWorkOrderRecordList,
	getWorkOrderByHourseId,
	saveWorkOrder,
	getCommunicationTypes,
	getCommunicationRecordList,
	saveCommunicationRecord,
	getCommunicationRecord,
	getDevData, 
	getDevHisData,
	getYxqkByHouseId} from '@/api'
  export default {
    data() {
    	//电话验证
		const validatePhone = (rule, value, callback) => {
	        let reg = /^1[345789]\d{9}$/;
	        if (value != '' && reg.test(value)) {
	          callback()
	        } else {
	          callback(new Error('请输入正确的手机号'))
	        }
	      }
      return {
      	equiLineTableList:[],//设备当前运行情况
      	equiTableData:[],//设备当前运行情况
      	dialogDevHistory:false,//设备历史情况
      	equiHisLineTableList:[],//设备当前运行情况
      	equiHisTableData:[],//设备当前运行情况
      	activeName:'first',//tabs切换的默认项
		show: false,
      	item:'',//设备新增弹框添加的
      	dialogTransfer:false,//转接弹框状态控制--gm
      	dialogaddequi:false,
      	dialogaddorder:false,
      	dialogdele:false,
      	name:"",
      	phone:"",
       	companyForm:{
       		name:""
       	},
       	companyNames:[],//模糊查询通过地址和电话查找房屋数据--gm
       	searchHouseMesg:'',//模糊查询input中的值--gm
        roomrules:{},
        communiaddrules:{},
        equiddrules:{},
        tabsNames:"客户信息",//底部折叠打开的
        equiTable:[],//设备表格

       customerMesgTable:[],//客户信息的表格
        roomForm:{//房屋信息--gm
        	areaadrs:"",
        	address:'',
        	structureArea:"",
        	heatingArea:"",
        	buildingStructure:[],
        	build:"",
        	wallThickness:"",
        	wallKeepWarm:"",
        	heatingTerminal:"",
        	heatingMode:"",
        	adrs:"",
        	
        },
        xzqNumber:'',
		aleradyAddList:[],//省市级联--gm
        areaadrslist:[],
        areaadrs: [],
      	addroomForm:{
      		name:"",
      		phone:"",
      		xlname:"",
      		xlphone:"",
      		type:"",
      		equi:[],
      		emergencyDegree:"",
      		desc:"",
      		person:"",
      		address:""
      	},
		equiaddForm:{ //设备修改弹框内容--gm
			classes:'',
			model:'',
			equipmentCompanyName:'',
			equipmentNumber:'',
			transmitNumber:''
			},
		phoneList: [], //转接分机号码下拉数据显示--gm
       	phoneListShow:[], //转接分机号码--gm
       	customerTotal:'',
       	buildingStructureName:'', //建筑结构状态
       	heatingModeName:'',
       	wallKeepWarmName:'',
       	heatingTerminalName:'', //下拉选择--gm
       	roomForm1:{  //用户信息部分信息
       		clientName:"",
        	sex:"",
        	idCard:""
       		},
       	deleState:0,//是否是客户的删除按钮
       	chooseHouseId:'',//选择房屋的id
       	clientID:'',//客户id
       	clientName:'',//点击保存的客户姓名
       	sureDeteleId:'',//确定删除的客户id
       	equiState:0,//设备弹框的新增编辑状态
       	title:'',//设备弹框头文字的改变
       	classesNameLabel:'',//设备类型
       	modelNameLabel:'',//设备品牌
       	equipmentCompanyNameLabel:'',//设备型号
       	selectedClasses:'',//临时存储的选择设备的类型
       	selectedEquiId:'',//传出去保存的设备id

       	rulesPhone: {//电话验证--wss-start
			contactTelephone:[{//
				validator: validatePhone,
				trigger: 'change'
			}]
		},
		searcopname: '', //搜索地址
		cust_numtips: '', // 标题-添加按钮
		dialogorderlook:false,//查看工单-弹出框
		emergencyDegreeSelect:[],//紧急程度
		emergencyDegreeValue:'',//紧急程度值
		workTypeSelect:[],//任务类型select
		workTypeValue:'',//任务类型select值
		handelUser:[],//处理人select
		classesMpdelNameCheckbox:[],//维修设备checkbox
		handelUserValue:'',//处理人select值
		classesMpdelNameValue:[],//维修设备checkbox值
		checkboxValue:false,//维修设备checkbox值选中
		workOrderId: '', // 工单ID
		orderaddForm:{//工单添加
			desc:'',
			contactTelephone:'',
			contactName:''
			},
		equipmentInfoDtos:[],//设备信息
		clienteleName:'',//客户姓名
		clientelephone:'',//客户电话
		gmtCreateDate:'',//创建时间（时间戳转时间使用）
		gmtModifiedDate: '',//处理时间（时间戳转时间使用）
		recordlistDate:[],//工单进度表
		customerTableDate:[],	//工单信息表
		totalWorkOrder: null,// 分页总条数-工单信息
		pageSizeWorkOrder:10,//当前分页一页多少条数-工单信息
		currentPageWorkOrder:1, //当前页数-工单信息
		communicationValue:'',//弹出框-沟通类型值
		communicationTypeSelect:[],//弹出框-沟通类型-select
		communicationTableDate:[],//沟通记录表
		communicationTypeName:'',//沟通类型
		desc:'',//描述
		userName:'',//创建人姓名
		gmtCreate:'',//创建时间
		dialogaddcommuni:false,//添加沟通记录-弹出框
		dialogaddcommunilook:false,//查看沟通记录-弹出框
		communiaddForm:{//添加沟通记录-form
			type:"",
			desc:""
			},
		totalCommunication: null,// 分页总条数-沟通记录
		currentPageCommunication:1,//当前页数-沟通记录
		pageSizeCommunication:10, //当前分页一页多少条数-沟通记录
		orderTypeName:'',//工单类型
		workTypeDesc:'',//任务类型
		emergencyDegree:'',//紧急程度
		address:'',
		status:'',
		operationUserName:'',
		contactName:'',
		contactPhone:'',
		loading: true,
		gzDataList: [],
		zcDataList: [],
		sbidArray:'',//获取sbid和ddid的数组
		runDeviceList:[],
		totalHistoryEqui: null,// 分页总条数-设备运行历史
		pageSizeHistoryEqui:10,//当前分页一页多少条数-设备运行历史
		currentPageHistoryEqui:1, //当前页数-设备运行历史
		showSbidBox:null,
		showSbidRun:null
      };
    },
    created(){
		
    	this.phone = this.$route.query.callPhone //接收其他页面传入的电话号码--gm
    	let searchHoustParams = { //进入页面根据电话进行模糊房屋的查询--gm
    		query: this.$route.query.callPhone,
    		page:1,
    		size:99999
    	}
    	this.searchHouseList(searchHoustParams)
    	//字典获取数据的部分---当前页面需要的字典中的内容打印:dictionaryValue
    	let dictionaryValue = JSON.parse(sessionStorage.getItem('dictionaryValue'))
    	//console.log(dictionaryValue)
      	dictionaryValue.map((item, index) => { //获取session中的字典内容,下拉选择的文字内容提取
	        if(item.typeValue == 'building_structure') { //建筑结构
	            this.roomForm.buildingStructure = item.paramParamList
	        }if(item.typeValue == 'heating_mode'){//供暖方式
	        	this.roomForm.heatingMode = item.paramParamList
	        }if(item.typeValue == 'wallKeep_warm'){//外墙保暖
	        	this.roomForm.wallKeepWarm = item.paramParamList
	        }if(item.typeValue == 'heating_terminal'){ //采暖末端
	        	this.roomForm.heatingTerminal = item.paramParamList
	        }if(item.typeValue == 'sex'){//性别
	        	this.roomForm1.sex = item.paramParamList
	        }if(item.typeValue == 'emergency_degree'){ //紧急程度
					this.emergencyDegreeSelect = item.paramParamList;
			}
	    })
      	this.getEquipmentClasses();//调用查询设备类型
      	this.getXzqhInfo([1]);//调用行政区划代码接口
      	//调用沟通类型查询接口（沟通类型下拉列表）
		let params1={
				query:'',
				status:0,
				size:9999,   //每页显示个数 (默认为10) 
				page:1,    //当前页数(默认为1)
			}
		this.getCommunicationTypes(params1);
		//任务类型下拉列表（调用任务类型查询接口）
		let params3={
			query: '',
			status: 0,
			page: 1,
			size: 9999
		}
		this.getTaskTypes(params3);
		//工单处理人下拉列表（调用可用业务人员查询）
		let params4={
			equipmentIds:""
		}
		this.getBusinessPersonnelList(params4);
		

    },
    mounted: function () {
	    this.phone = this.$route.query.callPhone //接收其他页面传入的电话号码--gm
    	let searchHoustParams = { //进入页面根据电话进行模糊房屋的查询--gm
    		query: this.$route.query.callPhone,
    		page:1,
    		size:99999
    	}
    	this.searchHouseList(searchHoustParams)
    	//字典获取数据的部分---当前页面需要的字典中的内容打印:dictionaryValue
    	let dictionaryValue = JSON.parse(sessionStorage.getItem('dictionaryValue'))
    	//console.log(dictionaryValue)
      	dictionaryValue.map((item, index) => { //获取session中的字典内容,下拉选择的文字内容提取
	        if(item.typeValue == 'building_structure') { //建筑结构
	            this.roomForm.buildingStructure = item.paramParamList
	        }if(item.typeValue == 'heating_mode'){//供暖方式
	        	this.roomForm.heatingMode = item.paramParamList
	        }if(item.typeValue == 'wallKeep_warm'){//外墙保暖
	        	this.roomForm.wallKeepWarm = item.paramParamList
	        }if(item.typeValue == 'heating_terminal'){ //采暖末端
	        	this.roomForm.heatingTerminal = item.paramParamList
	        }if(item.typeValue == 'sex'){//性别
	        	this.roomForm1.sex = item.paramParamList
	        }if(item.typeValue == 'emergency_degree'){ //紧急程度
					this.emergencyDegreeSelect = item.paramParamList;
			}
	    })
      	this.getEquipmentClasses();//调用查询设备类型
      	this.getXzqhInfo([1]);//调用行政区划代码接口
      	//调用沟通类型查询接口（沟通类型下拉列表）
		let params1={
				query:'',
				status:0,
				size:9999,   //每页显示个数 (默认为10) 
				page:1,    //当前页数(默认为1)
			}
		this.getCommunicationTypes(params1);
		//任务类型下拉列表（调用任务类型查询接口）
		let params3={
			query: '',
			status: 0,
			page: 1,
			size: 9999
		}
		this.getTaskTypes(params3);
		//工单处理人下拉列表（调用可用业务人员查询）
		let params4={
			equipmentIds:""
		}
		this.getBusinessPersonnelList(params4);
	},
    methods: {
    	getYxqkByHouseId(params){//获取sbid和ddid的接口
    		getYxqkByHouseId (params).then(res => {
				let code = res.data.code;
				let data = res.data.data.list;
				console.log(data)
				if(code == 0){
					this.sbidArray =data
				}else if(code == 1){
					this.$message({
		              message: '暂无数据'
		            })
				}
			});
    	},
    	getDevData(params){//当前设备运行情况
    		getDevData (params).then(res => {
				let code = res.data.retCode;
				let lineData = res.data.resTitle
				let tableData = res.data.page
				if(code == 0){
					this.runDeviceList =tableData;
				}else if(code == 1){
					this.$message({
		              message: '暂无数据'
		            })
				}
			});
    	},
    	getDevHisData(params){//设备运行历史情况接口
    		getDevHisData (params).then(res => {
				let code = res.data.retCode;
				let lineData = res.data.resTitle
				let tableData = res.data.page
				if(code == 0){
					this.equiHisTableData =tableData;
					this.equiHisLineTableList = lineData;
					this.totalHistoryEqui =res.data.recordcount;//总条数
				}else if(code == 1){
					this.$message({
		              message: '暂无数据'
		            })
				}
			});
    	},
    	lookDevHistory(sbId){
    		console.log(sbId)
    		this.dialogDevHistory = true;
    		let keyData =sessionStorage.getItem('equiLoginValue');
    		console.log(keyData)
    		//let number ='61880709261100023931';
    		let equiHisDataParams={
				param:'{"key":"'+keyData+'","reqData":{"sb_id":"'+sbId+'"}}'
			}
			console.log(equiHisDataParams)
			this.getDevHisData(equiHisDataParams)
    	},
		//格式化ChildrenData数据结构
		formatChildrenData(data){
			let childrenData = [];
			data.map((item, index) => {
				// this.roomForm.areaadrslist = data.xzqhmc;
				let itemData = {
					value:item.xzqhdm,
					label:item.xzqhmc,
					xzqhdm:item.xzqhdm,
					xzqhmc:item.xzqhmc
				};
				let xzqhdmLength = item.xzqhdm.length; 
				let lastXzqhdmData = parseInt(item.xzqhdm.substring(xzqhdmLength-2,xzqhdmLength));
				if(xzqhdmLength ===2 || lastXzqhdmData === 0){
					itemData.children = [];
				}
				childrenData.push(itemData);
			})
			return childrenData;
		},		
		//查找要添加的上级并添加子项
		findChildrenData(sourcedata,xzqhdm,data){
			sourcedata.forEach((item,index)=>{
				if(item.value == xzqhdm[xzqhdm.length-1]){
					item.children = this.formatChildrenData(data);
					return;
				}
				if(item.children && item.children.length > 0){
					this.findChildrenData(item.children,xzqhdm,data);
				}
			});
		},
		// gm行政区划部分gm
		getXzqhInfo(reqParam){ //房屋区域查询接口
			let reqData = {};
			if(reqParam && reqParam.length>0 && reqParam[0] !==1 ){
				reqData = {xzqhdm:reqParam[reqParam.length-1]};
			}
      		getXzqhInfo(reqData).then(res => {
				//console.log(res)
				let code = res.data.code;//通过code判断是否有数据
				let data = res.data.data;
				if(code == 0) {
					//console.log(data);
					if(this.aleradyAddList.indexOf(reqParam[reqParam.length-1]) === -1){
						let childrenData = this.formatChildrenData(data);
						if(reqParam.length === 1 && reqParam[0] === 1){
							this.areaadrs = childrenData;
						}else{
							this.findChildrenData(this.areaadrs,reqParam,childrenData);
						}
					  this.aleradyAddList.push(reqParam);
					}
				} else if(code == 1) {
					this.$message({
						message: '信息保存失败'
					});
				} 
			});
    	},
	    areaChoose(val){ //省市区级联选择
			this.getXzqhInfo(val)
		},
      	saveHouse(params){//调用房屋保存
			saveHouse(params).then(res => {
				//console.log(res)
				let code = res.data.code;//通过code判断是否有数据
				let data = res.data.data
				if(code == 0) {
					this.$message({
						message: '保存成功'
					});
					this.clientName =this.roomForm1.clientName //保存客户姓名

					let customerParams ={ //下面关联的客户信息刷新查询
				  		houseId: data,
				  		page:'1',
				  		size:'99999'
				  	}
				  	if(this.chooseHouseId == ""){//新增房屋信息是传出的房屋id
				  		this.chooseHouseId =data
				  		//console.log(this.chooseHouseId)
				  	}
		  			this.customerList(customerParams)
				} else if(code == 1) {
					this.$message({
						message: '信息保存失败'
					});
				} 
			});
    	},
      	chooseHouseMesg(params){ //调入弹屏接口-房屋查询信息--点击一个房屋信息之后执行--gm
      		popChooseHouseMesg(params).then(res => {
				//console.log(res)
				this.clientName =this.roomForm1.clientName
				let code = res.data.code;//通过code判断是否有数据
				if(code == 0) {
					// 运行设备--gmgmgm
					//设备当前运行情况的调用-------gmgmgmgm
					let keyData =sessionStorage.getItem('equiLoginValue');
					console.log(keyData)
					// let ddIdNumber = '11011610200800988535';//地点===gmgm需要后台给出地点id-==设备假数据
					// let equiDataParams={
					// 	param:'{"key":"'+keyData+'","reqData":{"dd_id":"'+ddIdNumber+'"}}'
					// }
					// console.log(equiDataParams)
					// this.getDevData(equiDataParams)
					console.log(this.sbidArray[0])
					if(this.sbidArray.length>0 && this.sbidArray[0] != null){
						this.showSbidBox=false
						this.showSbidRun=true;
						console.log(this.sbidArray.length)
						this.sbidArray.map(item => {
							console.log(item)
							let equiDataParams={
								param:'{"key":"'+keyData+'","reqData":{"dd_id":"'+item.ddId+'","sb_id":"'+item.sbId+'"}}'
							}
							console.log(equiDataParams)
							this.getDevData(equiDataParams)
						})
					}else{//如果没有数据,不显示设备运行内容,显示暂无数据
						this.showSbidBox=true;
						this.showSbidRun=false;
					}
	  				//运行设备--gmgmgm
					let data = res.data.data
					console.log(data)
					//console.log(data.xzqhdmPath)
					this.roomForm = data
					// 数据回显的部分调整---未完成
					let xzqhCode = data.xzqhdmPath
					let xzqhCodeName = data.xzqhdmPathName
					//this.areaadrslist =xzqhCode
					xzqhCode.forEach((item,index)=>{
						this.areaChoose([item]);
					})
					setTimeout(this.areaadrslist =xzqhCode,10000);
					//console.log(this.areaadrslist) //编号的数组
					//console.log(xzqhCodeName)  //文字的数组
					// xzqhCode.forEach((item,index) => {
					// 	this.areaadrslist= item[index]
						
					// })
					// 数据回显的部分调整---未完成					
					//console.log(this.areaadrslist)
					let buildingText = data.buildingStructure //建筑结构获取到的值--buildingStructureName是名称
					let heatingModeText = data.heatingMode //供暖方式获取到的值--heatingModeName是名称
					let heatingTerminalText = data.heatingTerminal //采暖末端获取到的值--buildingStructureName是名称
					let wallKeepWarmText = data.wallKeepWarm //外皮昂保温获取到的值--buildingStructureName是名称
					console.log(data.wallKeepWarm)
					// 加载下拉框的内容---点击之后的对下拉框进行初始赋值
					let dictionaryValue = JSON.parse(sessionStorage.getItem('dictionaryValue'))
			      	dictionaryValue.map((item, index) => { //获取session中的字典内容,下拉选择的文字内容提取
				        if(item.typeValue == 'building_structure') {
				            this.roomForm.buildingStructure = item.paramParamList
				            //this.buildingStructureName =item.paramParamList[data.buildingStructure]
				            this.roomForm.buildingStructure.map(item => {
				            	if(item.paramValue == buildingText) {  //建筑结构判断获取的值找到对应的名称
				            		this.buildingStructureName = item.paramValue
				            	}
				            })
				        }if(item.typeValue == 'heating_mode'){
				        	this.roomForm.heatingMode = item.paramParamList
				        	//this.heatingModeName =item.paramParamList[data.heatingMode]
				            this.roomForm.heatingMode.map(item => { //供暖方式
				            	if(item.paramValue == heatingModeText) {
				            		this.heatingModeName = item.paramValue
				            	}
				            })
				        }if(item.typeValue == 'wallKeep_warm'){
				        	this.roomForm.wallKeepWarm = item.paramParamList
				        	//this.wallKeepWarmName =item.paramParamList[data.wallKeepWarm]
				            this.roomForm.wallKeepWarm.map(item => { //外墙保温
				            	if(item.paramValue == wallKeepWarmText) {
				            		this.wallKeepWarmName = item.paramValue
				            	}
				            })
				        }if(item.typeValue == 'heating_terminal'){
				        	this.roomForm.heatingTerminal = item.paramParamList
				        	//this.heatingTerminalName =item.paramParamList[data.heatingTerminal]
				            this.roomForm.heatingTerminal.map(item => { //采暖末端
				            	if(item.paramValue == heatingTerminalText) {
				            		//alert(item.paramValue)
				            		this.heatingTerminalName = item.paramValue
				            	}
				            })
				        }
				    })
				} else if(code == 1) {
					this.$message({
						message: '信息调取失败'
					});
				} 
			});
	    },
      	userPhoneList () {//调入分机号码接口
			pbxUserPhoneList ().then(res => {
				let code = res.data.code;
				if(code == 0){
					let data = res.data.device;
					this.phoneList = data;
				}else if(code == 1){
					this.$message({
		              message: '分机号码获取失败'
		            })
				}
			});
		},
      	handleMute () {//电话静音保持
	      	let params={ //入参只有通化号码divice
				device: sessionStorage.getItem('device')
			}
	      	pxbPhoneMute(params).then(res => {
				//console.log(res)
				let code = res.data.code;//通过code判断是否有数据
				if(code == 0) {
					this.$message({
						message: '操作成功'
					})
				} else if(code == 1) {
					this.$message({
						message: '分机号错误'
					});
				} else if(code == 2) {
					this.$message({
						message: '被叫号错误'
					});
				} else if(code == 3) {
					this.$message({
						message: '操作失败'
					});
				}
			});
	    },
        controlTransfer (params) { //转接接口调入
			pbxUserServiceControl(params).then(res => {
				//console.log(res)
				let code = res.data.code;//通过code判断是否有数据
				if(code == 0) {
					this.$message({
						message: '转接成功'
					})
				} else if(code == 1) {
					this.$message({
						message: '分机号错误'
					});
				} else if(code == 2) {
					this.$message({
						message: '被叫号错误'
					});
				} else if(code == 3) {
					this.$message({
						message: '操作失败'
					});
				}
			});
	    },
        handleHang (index,row){ //挂断接口调用
			let params={ //入参只有通化号码divice
				device: sessionStorage.getItem('device')
			}
			//console.log(params.device)
			pbxUserServiceHang(params).then(res => {
				//console.log(res)
				let code = res.data.code;//通过code判断是否有数据
				if(code == 0) {
					this.$message({
						message: '电话挂断'
					})
				} else if(code == 1) {
					this.$message({
						message: '分机号错误'
					});
				} else if(code == 3) {
					this.$message({
						message: '挂断失败'
					});
				}
			});
		},
	    handleTransfer(){ //点击转接--打开转接弹框
		  	this.userPhoneList(); //调入分机号码接口
		  	this.dialogTransfer = true;
		},
	    okTransferBtn(){ //确认转接按钮
		  	let params = {
		  		device1: sessionStorage.getItem('device'),
		  		device2: this.phoneListShow
		  	}
		  	if(params.device1 !== params.device2){
		  		this.controlTransfer(params);
		  		this.dialogTransfer = false;
		  	}else{
		  		this.$message({
					message: '无法转接给自己!'
				})
		  	}
		},
	    searchHouseList(params){ //根据地址,电话模糊查询房屋--初始进来查询一次,之后点击在查询
		  	popUpHouseList(params).then(res => {
				//console.log(res)
				let code = res.data.code;//通过code判断是否有数据
				if(code == 0) {
					let data = res.data.data.list;
					this.companyNames =data
					if(data.length>0){//有超过一条房屋数据,默认第一条房屋内容作为显示项
					  	this.defaultHouseMesg(data[0].houseId) ;//默认显示第一条房屋数据
					}
					this.loading = false //加载部分内容
				} else if(code == 1) {
					this.$message({
						message: '数据获取失败'
					});
				}
			});
		},
	  	deteleClienteleMesg(params){  //删除客户信息
		  	popDeteleClienteleMesg(params).then(res => {
				//console.log(res)
				let code = res.data.code;//通过code判断是否有数据
				if(code == 0) {
					//console.log('删除成功')
					let customerParams ={ //下面关联的客户信息查询
						houseId: this.chooseHouseId,
						page:'1',
						size:'99999'
					}
					this.customerList(customerParams)
				} else if(code == 1) {
					this.$message({
						message: '删除失败'
					});
				}
			});
		},
	    chooseHouseClienteleMesg(params){ //点击调入客户查询接口右侧--有问题没调明白的--用户信息的内容部分
		  	popChooseHouseClienteleMesg(params).then(res => {
				//console.log(res)
				let code = res.data.code;//通过code判断是否有数据
				if(code == 0) {
					let data = res.data.data;
					//console.log(data)
					this.roomForm1 =data;
					//this.roomForm1.sex =data.sex
					this.clientID = data.clientInfoId;//当前客户ID

					//console.log(this.clientID)
					//console.log(this.roomForm1.sex)
				} else if(code == 1) {
					this.$message({
						message: '数据获取失败'
					});
				}
			});
		},
	    customerList(params){ //调用客户信息查询--底部客户信息表格的部分
		  	getCustomerList(params).then(res => {
				//console.log(res)
				let code = res.data.code;//通过code判断是否有数据
				if(code == 0) {
					let data = res.data.data.list;
					data.map((item, index) => {
						this.customerMesgTable =data
					})
				} else if(code == 1) {
					this.$message({
						message: '数据获取失败'
					});
				}
			});
		},
	    getDeviceList(params){ //下面关联的设备信息表格
			getDeviceList(params).then(res => {
				//console.log(res)
				let code = res.data.code;//通过code判断是否有数据
				if(code == 0) {
					let data = res.data.data;
					this.equiTable =data.list;
				} else if(code == 1) {
					this.$message({
						message: '数据获取失败'
					});
				}
			});
		},
	  	deteleDeviceMesg(params){  //下面设备表格中删除按钮接口的调入
	  		popDeteleDeviceMesg(params).then(res => {
				//console.log(res)
				let code = res.data.code;//通过code判断是否有数据
				if(code == 0) {
					//console.log('删除成功')
					let equiParams ={ //下面关联的设备信息查询
				  		houseId: this.chooseHouseId,
				  		page:'1',
				  		size:'99999'
				  	}
				  	this.getDeviceList(equiParams)
				} else if(code == 1) {
					this.$message({
						message: '删除失败'
					});
				}
			});
		},
	    getEquipmentClasses(){ //调入查询设备类型接口---打印data设备类型的数据
			getEquipmentClasses().then(res => {
				//console.log(res)
				let code = res.data.code;//通过code判断是否有数据
				if(code == 0) {
					let data = res.data.data;
					//console.log(data)
					this.equiaddForm.classes =data;//设备类型的数组传入
				} else if(code == 1) {
					this.$message({
						message: '设备类型查询失败'
					});
				}
			});
		},
	    onSelectedClasses(item,index){ //调入查询设备品牌接口,选择类型之后进行查询
	  	    //console.log(item)
	  	    //console.log(this.equiaddForm.classes)
	  		this.selectedClasses =item
	  		let params ={
	  			classes: item
	  		}
			getTrademarks(params).then(res => {
				//console.log(res)
				let code = res.data.code;//通过code判断是否有数据
				if(code == 0) {
					let data = res.data.data;
					console.log(data)
					this.equipmentCompanyNameLabel=''
					this.modelNameLabel=''
					this.equiaddForm.model =data
				} else if(code == 1) {
					this.$message({
						message: '设备品牌查询失败'
					});
				}
			});
		},
	  	onSelectedModel(item,index){ //调入选择设备型号
	  		//console.log(item)
	  		//console.log(this.equiaddForm.model)
	  		let params ={
	  			classes: this.selectedClasses,
	  			trademarkId: item
	  		}
	  		getEquiModels(params).then(res => {
				//console.log(res)
				let code = res.data.code;//通过code判断是否有数据
				if(code == 0) {
					let data = res.data.data;
					console.log(data)
					this.modelNameLabel=''
					this.equiaddForm.equipmentCompanyName =data
				} else if(code == 1) {
					this.$message({
						message: '设备型号查询失败'
					});
				}
			});
	  	},
  	  	onSelectedEquiId(item){//选择设备型号,保存设备类型id:deviceId
	  		this.selectedEquiId = item 
	  		//console.log(item)
	  	},
	    saveOrModifyDevice(params){ //调用新增编辑设备接口--设备表格上面的新增编辑
			saveOrModifyDevice(params).then(res => {
				//console.log(res)
				let data = res.data.data;
				let code = res.data.code;//通过code判断是否有数据
				if(code == 0) {//添加成功进行刷新设备信息表格
					let equiParams ={ //下面关联的设备信息查询
				  		houseId: this.chooseHouseId,
				  		page:'1',
				  		size:'99999'
				  	}
				  	this.getDeviceList(equiParams)			
				} else if(code == 1) {
					this.$message({
						message: '设备信息保存失败'
					});
				}
			});
		},
	  	handleSizeChangeHistoryEqui (val) { //改变每页的条数-设备运行情况历史--暂时不做分页
			this.pageSizeHistoryEqui = val;
			this.currentPageHistoryEqui = 1
			let keyData =sessionStorage.getItem('equiLoginValue');
    		console.log(keyData)
    		let number ='61880709261100023931';
    		let equiHisDataParams={
				param:'{"key":"'+keyData+'","reqData":{"sb_id":"'+sbId+'","pagesize":"'+this.pageSizeHistoryEqui+'","pageid":"'+this.currentPageHistoryEqui+'"}}'
			}
			console.log(equiHisDataParams)
			this.getDevHisData(equiHisDataParams)
		},
	    handleCurrentChangeHistoryEqui (val) { //改变当前页-设备运行情况历史--暂时不做分页
			this.currentPageHistoryEqui = val
			let keyData =sessionStorage.getItem('equiLoginValue');
    		console.log(keyData)
    		let number ='61880709261100023931';
    		let equiHisDataParams={
				param:'{"key":"'+keyData+'","reqData":{"sb_id":"'+sbId+'","pagesize":"'+this.pageSizeHistoryEqui+'","pageid":"'+this.currentPageHistoryEqui+'"}}'
			}
			console.log(equiHisDataParams)
			this.getDevHisData(equiHisDataParams)
		},
	    getWorkOrderByHourseId(params){  //工单信息查询接口--wss  
			getWorkOrderByHourseId(params).then(res => {   
				let code = res.data.code;
				if(code == 0){
					let data = res.data.data
					this.customerTableDate = data.list
					this.totalWorkOrder = data.pageInfo.total
				}else if(code == 1){
					this.$message({
						message: res.data.msg
					})
				}
			})
		},
	    saveWorkOrder(params){  //工单信息添加接口--wss 
			saveWorkOrder(params).then(res => {   
				let code = res.data.code;
				if(code == 0){
					let params2 = {
						houseId: this.chooseHouseId, //房屋id--------------(需要修改)
						page: this.currentPageWorkOrder,
						size: this.pageSizeWorkOrder
					}
					//console.log(params2.houseId)
					//console.log(res.data.data)
					this.getWorkOrderByHourseId(params2);
					this.dialogaddorder = false;//隐藏
				}else if(code == 1){
					this.$message({
						message: res.data.msg
					})
				}
			})
		},
	    getWorkOrder(params){   //工单详细信息查看接口--wss                  
			getWorkOrder(params).then(res => {
				let code = res.data.code;
				//console.log(res)
				if(code == 0){
					let data = res.data.data;
					this.status=data.status
					this.userName = data.userName
					this.gmtCreate = this.getDate(data.gmtCreate)
					this.operationUserName = data.operationUserName
					this.gmtModifiedDate = data.gmtModified
					this.customerName = data.customerName
					this.customerPhone = data.customerPhone
					this.contactName = data.contactName
					this.contactPhone = data.contactPhone
					this.address = data.address
					this.classes = data.classes
					this.emergencyDegree = data.emergencyDegree
					this.workTypeDesc = data.workTypeDesc
					this.desc = data.desc
					this.orderTypeName = data.orderTypeName
					if (data.equipmentInfoDtos.length > 0) {
						this.show = true
						this.equipmentInfoDtos = data.equipmentInfoDtos
					} else {
						this.show = false
						this.equipmentInfoDtos = ''
					}
					this.loading = false
				}else if(code == 1){
					this.$message({
						message: res.data.msg
					})
				}
			})
		},
	    getWorkOrderRecordList(paramsRecordLlist) {//工单进度--wss
			getWorkOrderRecordList(paramsRecordLlist).then(res => {
				let code = res.data.code
				if (code == 0) {
					let data = res.data.data
					this.recordlistDate = data
					//console.log(res.data.data)
				}
			})
		},
	    getTaskTypes(params){ //任务类型查询查询接口（获取任务类型下拉列表）--wss
			getTaskTypes(params).then(res => {   
				let code = res.data.code;
				if(code == 0){
					let data = res.data.data;
					this.workTypeSelect = data.list;
				}else if(code == 1){
					this.$message({
						message: res.data.msg
					})
				}
			})
		},
	    getBusinessPersonnelList(params){  //可用业务人员查询接口（获取工单处理人下拉列表）--wss  
			getBusinessPersonnelList(params).then(res => {   
				let code = res.data.code;
				// console.log(res.data.data);
				if(code == 0){
					let data = res.data.data;
					this.handelUser = data;
					//console.log(data)
				}else if(code == 1){
					this.$message({
						message: res.data.msg
					})
				}
			})
		},
	    getDeviceSelectList(params){ //设备信息查询接口(获取维修设备多选框)--wss   
			getDeviceList(params).then(res => {   
				let code = res.data.code;
				//console.log(res);
				if(code == 0){
					let data = res.data.data;
					this.classesMpdelNameCheckbox = data.list;
					//console.log(this.classesMpdelNameCheckbox)
				}else if(code == 1){
					this.$message({
						message: res.data.msg
					})
				}
			})
		},
	    getCommunicationTypes(params){ //沟通类型查询接口--wss   
			getCommunicationTypes(params).then(res => {   
				let code = res.data.code;
				if(code == 0){
					let data = res.data.data
					this.communicationTypeSelect = data.list
				}else if(code == 1){
					this.$message({
						message: res.data.msg
					})
				}
			})
		},
	    getCommunicationRecordList(params){ //沟通记录查询接口--wss   
			getCommunicationRecordList(params).then(res => {   
				let code = res.data.code;
				// console.log(res)
				if(code == 0){
					let data = res.data.data
					this.communicationTableDate=data.list
					this.totalCommunication = data.pageInfo.total
				}else if(code == 1){
					this.$message({
						message: res.data.msg
					})
				}
			})
		},
	    saveCommunicationRecord(params){   //添加沟通记录--wss 
			saveCommunicationRecord(params).then(res => {   
				let code = res.data.code;
				if(code == 0){
					//调用沟通记录查询接口（沟通类型表）
					let params={
						houseId: this.chooseHouseId,//房屋id-----------（需要修改）
						customerId: this.clientID,//客户id-----------（需要修改）
						page: this.currentPageCommunication,
						size: this.pageSizeCommunication
					}
					this.getCommunicationRecordList(params);
				}else if(code == 1){
					this.$message({
						message: res.data.msg
					})
				}
			})
		},
	    getCommunicationRecord(params){//沟通记录详细信息接口-查看--wss
			getCommunicationRecord(params).then(res => {   
				let code = res.data.code;
				// console.log(res)
				if(code == 0){
					let data =res.data.data
					this.communicationTypeName=data.communicationTypeName
					this.desc	=data.desc
					this.gmtCreate=this.getDate(data.gmtCreate)
					this.userName=data.userName
				}else if(code == 1){
					this.$message({
						message: res.data.msg
					})
				}
			})
		},
	    handleSizeChangeWorkOrder (val) { //改变每页的条数-工单信息--wss
			this.pageSizeWorkOrder = val;
			this.currentPageWorkOrder = 1
			let params={
				houseId: this.chooseHouseId,//房屋id-----------------（需要修改）
				page: this.currentPageWorkOrder,
				size: this.pageSizeWorkOrder
			}
			this.getWorkOrderByHourseId(params);
		},
	    handleCurrentChangeWorkOrder (val) { //改变当前页-工单信息--wss
			this.currentPageWorkOrder = val
			let params={
				houseId: this.chooseHouseId,//房屋id-----------------（需要修改）
				page: this.currentPageWorkOrder,
				size: this.pageSizeWorkOrder
			}
			this.getWorkOrderByHourseId(params);
		},
	    handleSizeChange (val) { //改变每页的条数-沟通记录--wss
			this.pageSizeCommunication = val;
			this.currentPageCommunication = 1
			let params={
				houseId: this.chooseHouseId,//房屋id------------（需要修改）
				customerId: this.clientID,//客户id----------（需要修改）
				page: this.currentPageCommunication,
				size: this.pageSizeCommunication
			}
			this.getCommunicationRecordList(params);
		},
	    handleCurrentChange (val) { //改变当前页-沟通记录--wss
			this.currentPageCommunication = val
			let params={
				houseId: this.chooseHouseId,//房屋id------------（需要修改）
				customerId: this.clientID,//客户id----------（需要修改）
				page: this.currentPageCommunication,
				size: this.pageSizeCommunication
			}
			this.getCommunicationRecordList(params);
		},
	    getDate (item) {//时间戳转时间
	        var date = new Date(item);
	        // var y = 1900+date.getYear();
	        // var m = "0"+(date.getMonth()+1);
	        // var d = "0"+date.getDate();
	        // return y+"-"+m.substring(m.length-2,m.length)+"-"+d.substring(d.length-2,d.length)
	        var Y = date.getFullYear() + '-';
	        var M = (date.getMonth()+1 <= 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
	        var D = (date.getDate()+1 <= 10 ? '0'+date.getDate() : date.getDate() )+ ' ';
	        var h = (date.getHours()+1 <= 10 ? '0'+date.getHours() : date.getHours() )+ ':';
	        var m = (date.getMinutes()+1 <= 10 ? '0'+date.getMinutes() : date.getMinutes() )+ ':';
	        var s = (date.getSeconds()+1 <= 10 ? '0'+date.getSeconds() : date.getSeconds() );
	        return Y+M+D+h+m+s;
		},
		//方法逻辑,上面是接口调用
	    searchBtn(){ //点击左侧查询地址或电话查找房屋--gm
	  		if (this.loading) {
				return
			}
			this.loading = true
		  	let params ={
		  		query: this.searchHouseMesg
		  	}
		  	this.searchHouseList(params);
		},
	    defaultHouseMesg(houseId){ //房屋地址超过一个的时候,默认显示第一个的房屋信息----的实现方法
	  		let yxqk= {
	  			houseId:houseId
	  		}
	  		this.getYxqkByHouseId(yxqk);//获取房屋sbid和ddid的接口
			this.chooseHouseId =houseId //当前房屋的房屋ID
			//console.log(this.chooseHouseId)
		  	let params ={//房屋信息的查询--上面编辑内容的部分--gm
		  		houseId: houseId
		  	}
		  	this.chooseHouseMesg(params) 
		  	let clientParams ={ //房屋信息的查询--上面编辑内容的用户部分--gm--姓别有问题
		  		houseId: houseId,
		  		query: this.$route.query.callPhone
		  	}
		  	this.chooseHouseClienteleMesg(clientParams) 
		  	//console.log(this.clientID)
			//传入点击房屋地址的房屋ID作为参数调用下面四个大表格信息
		  	//console.log(this.roomForm.wallKeepWarm)
		  	let customerParams ={ //下面关联的客户信息查询
		  		houseId: houseId,
		  		page:'1',
		  		size:'99999'
		  	}
		  	this.customerList(customerParams)
		  	let equiParams ={ //下面关联的设备信息查询
		  		houseId: houseId,
		  		page:'1',
		  		size:'99999'
		  	}
		  	this.getDeviceList(equiParams)
		  	//调用沟通记录查询接口（沟通类型表）----wss
			let communicationParams={
    			houseId: houseId,
				customerId: this.clientID,//客户id-----------------（需要修改）
				page: this.currentPageCommunication,
				size: this.pageSizeCommunication
	    	}
	    	this.getCommunicationRecordList(communicationParams);
		  //调用工单信息查询（工单信息表）
			let params2 = {
    			houseId: houseId, 
				page: this.currentPageWorkOrder,
				size: this.pageSizeWorkOrder
			}
			this.getWorkOrderByHourseId(params2);
		  },
	    chooseHouseMesgBtn(item,index){ //点击左侧单个房屋地址,查找房屋信息--初始查询都在这里面
			let yxqk= {
	  			houseId:item.houseId
	  		}
	  		this.getYxqkByHouseId(yxqk);//获取房屋sbid和ddid的接口
		    this.chooseHouseId =item.houseId //当前房屋的房屋ID
		  //console.log(this.chooseHouseId)
		  	let params ={//房屋信息的查询--上面编辑内容的部分--gm
		  		houseId: item.houseId
		  	}
		  	this.chooseHouseMesg(params) 
		  	let clientParams ={ //房屋信息的查询--上面编辑内容的用户部分--gm--姓别有问题
		  		houseId: item.houseId,
		  		query: this.$route.query.callPhone
		  	}
		  	this.chooseHouseClienteleMesg(clientParams) 
		  	//console.log(this.clientID)
			//传入点击房屋地址的房屋ID作为参数调用下面四个大表格信息
		  	//console.log(this.roomForm.wallKeepWarm)
		  	let customerParams ={ //下面关联的客户信息查询
		  		houseId: item.houseId,
		  		page:'1',
		  		size:'99999'
		  	}
		  	this.customerList(customerParams)
		  	let equiParams ={ //下面关联的设备信息查询
		  		houseId: item.houseId,
		  		page:'1',
		  		size:'99999'
		  	}
		  	this.getDeviceList(equiParams)
		  	//调用沟通记录查询接口（沟通类型表）----wss
			let communicationParams={
    			houseId: item.houseId,
				customerId: this.clientID,//客户id-----------------（需要修改）
				page: this.currentPageCommunication,
				size: this.pageSizeCommunication
	    	}
	    	this.getCommunicationRecordList(communicationParams);
		  //调用工单信息查询（工单信息表）
			let params2 = {
    			houseId: item.houseId, 
				page: this.currentPageWorkOrder,
				size: this.pageSizeWorkOrder
			}
			this.getWorkOrderByHourseId(params2);
		},
	    deteleClienteleBtn(item,row){//下面关联的客户信息删除--确认删除gm
		  	this.dialogdele = true;
		  	this.deleState =1
		  	this.sureDeteleId=row.id
		},
	    deteleEquiBtn(item,row){//下面关联的设备信息删除--确认删除gm
		  	this.dialogdele = true;
		  	this.deleState =0
		  	this.id=row.id
		},
	    onDetele(){ //客户信息删除/设备信息删除
		  	if(this.deleState == 1){//客户信息确认删除
		  		let params ={ 
			  		houseId: this.chooseHouseId,
			  		customerId: this.sureDeteleId
			  	}
			  	this.deteleClienteleMesg(params)
			  	this.dialogdele = false
		  	}else if(this.deleState ==0){//设备信息确认删除
		  		let params ={ 
			  		id: this.id
			  	}
			  	this.dialogdele = false
		  		this.deteleDeviceMesg(params)
		  	}
		},
	    equiChangeBtn (index,row){//点击新增，编辑按钮
			this.dialogaddequi = true;
			if(row){ //有row是编辑按钮点击进入的
				this.classesNameLabel = row.classes;
				this.modelNameLabel = row.model;
				this.equipmentCompanyNameLabel = row.equipmentCompanyName;
				this.equiaddForm.equipmentNumber = row.equipmentNumber;
				this.equiaddForm.transmitNumber = row.transmitNumber;
				this.deviceId = row.equipmentTypeId
				this.equiState = 1;
				this.id= row.id
				this.title = '编辑设备'
			}else{ //没有row是新增按钮点击进入的
				this.classesNameLabel = '';
				this.modelNameLabel = '';
				this.equipmentCompanyNameLabel = '';
				this.equiaddForm.equipmentNumber = '';
				this.equiaddForm.transmitNumber = '';
				this.equiState = 0;
				this.title ='新增设备'
				//console.log(this.title)
			}
		},
	    onEquiSave(){
  			if(this.equiaddForm.equipmentNumber !=='' && this.equiaddForm.transmitNumber !==''){
  				if(this.equiState==0){//新增设备的保存
	  				let params ={ //调用保存接口
	  					id:'',
	  					deviceId: this.selectedEquiId,
						houseId: this.chooseHouseId,
						equipmentNumber: this.equiaddForm.equipmentNumber,
						transmitNumber: this.equiaddForm.transmitNumber
	  				}
	  				this.saveOrModifyDevice(params)
	  			}else if(this.equiState == 1){
	  				let params ={ //调用保存接口
	  					// id: this.equipmentCompanyNameLabel,
	  					//id: this.equiaddForm.equipmentCompanyNameLabel,
	  					id: this.id,
	  					deviceId: this.selectedEquiId,
						houseId: this.chooseHouseId,
						equipmentNumber: this.equiaddForm.equipmentNumber,
						transmitNumber: this.equiaddForm.transmitNumber
	  				}
	  				//console.log(params.deviceId)
	  				this.saveOrModifyDevice(params)
	  			}
  				this.dialogaddequi =false
  			}else{//判断不能为空
  				this.$message({
					message: '设备序列号或者传输序列号不能为空'
				});
  			}
	  	},
	    resetForm() {//重置取消--gm
	        this.$refs['roomForm1'].resetFields();
	        this.$refs['roomForm'].resetFields();
	        this.heatingModeName="";
	        this.buildingStructureName='';
	        this.wallKeepWarmName='';
	        this.heatingTerminalName="";
	    },
        saveHouseBtn(formName) {//点击保存按钮--保存  传出行政区代码::xzqNumber
      		let args = this.areaadrslist
      		this.xzqNumber = args[args.length - 1]
      		//console.log(args)
      		//console.log(this.xzqNumber)
			let params ={
	   			houseId:this.chooseHouseId,
	   			customerId:this.clientID,
	   			xzqhdm: this.xzqNumber,//需要修改的动态数据------------------------------gm
	   			structureArea: this.roomForm.structureArea,
	   			hourseAddress:this.roomForm.address,
	   			heatingArea:this.roomForm.heatingArea,
	   			buildingStructure:this.buildingStructureName,
	   			build:this.roomForm.build,
	   			wallThickness:this.roomForm.wallThickness,
	   			wallKeepWarm:this.wallKeepWarmName,
	   			heatingTerminal:this.heatingTerminalName,
	   			heatingMode:this.heatingModeName,
	   			customerName:this.roomForm1.clientName,
	   			phone:this.phone,
	   			customerSex:this.roomForm1.sex,
	   			customerCard:this.roomForm1.idCard
	   		}
			//console.log(params.xzqhdm)//保存的行政的编码
			//this.clientID = res.data.data.clientInfoId;//当前客户ID
	   		this.saveHouse(params)
	    },
	    //gm方法-end-gm
        handleLookorder(index, row) { //工单-查看--wss
		    //console.log(row.workerOrderId)
		    this.workOrderId = row.workerOrderId
			let params={
				workOrderId: this.workOrderId
				// workOrderId:12
			}
			this.getWorkOrder(params)
			//工单跟踪记录
			let paramsRecordLlist = {
				workOrderId: this.workOrderId
			}
			this.getWorkOrderRecordList(paramsRecordLlist)
		    this.dialogorderlook=true
		}, 
	    handleAddorder(index, row) {//添加工单信息--wss	
	  	    this.clientName = this.roomForm1.clientName;//获取input中的数据,不点击保存按钮的时候可以获取到
			this.clienteleName= this.clientName//客户姓名----------------(可能需要修改)
			this.clientelephone=this.phone//客户电话-------------(可能需要修改)
			this.orderaddForm.contactTelephone=this.phone//联系人电话-------------------(可能需要修改)
			this.orderaddForm.contactName=this.clientName//联系人姓名-------------------(可能需要修改)
			this.orderaddForm.desc=""
			this.workTypeValue=''
			this.emergencyDegreeValue=''
			this.classesMpdelNameValue=[] //多选置空
			this.handelUserValue=''
       		this.dialogaddorder=true
       		//维修设备下拉菜单（调用设备信息查询接口）
			let params5={
				houseId: this.chooseHouseId,
				page:1,
				size:9999
			}
			this.getDeviceSelectList(params5);
			let clientParams ={ //房屋信息的查询--上面编辑内容的用户部分--gm--姓别有问题
		  		houseId: this.chooseHouseId,
		  		query: this.$route.query.callPhone
		  	}
		  	//console.log(clientParams.houseId)
  			this.chooseHouseClienteleMesg(clientParams) 
		},
		canleWork (orderaddForm) {
			this.$refs[orderaddForm].resetFields();
			this.dialogaddorder = false
		},
	    submitaddWorkOrderForm (orderaddForm) {//添加工单信息-保存按钮--wss
			// this.$refs[orderaddForm].validate((valid) => {
				// alert(this.orderaddForm.contactTelephone)
				// if(valid) {
			let params={
				houseId: this.chooseHouseId,//房屋id----------(需要修改)
				clienteleId: this.clientID,//客户id------------(需要修改)
				contactTelephone: this.orderaddForm.contactTelephone,//联系人电话----(需要修改)
				contactName: this.orderaddForm.contactName,//联系人姓名------(需要修改)
				workTypeId: this.workTypeValue,//工单任务类型id
				emergencyDegreeId:this.emergencyDegreeValue,//紧急程度id
				equipmentIds: this.classesMpdelNameValue,//维修设备id
				maintainId:this.handelUserValue,//业务支持人员id-处理人
				desc: this.orderaddForm.desc//描述
			}
			this.saveWorkOrder(params);
				// } else {
				// 	console.log('error submit!!');
				// 	return false;
				// }
			// })
			this.$refs[orderaddForm].resetFields();
		},
        handleAddcommuni() {//添加沟通记录按钮
	        this.dialogaddcommuni = true
	        this.communicationValue=''  
	        this.communiaddForm.desc=''
	        let clientParams ={ //房屋信息的查询--上面编辑内容的用户部分--gm--姓别有问题
		  		houseId: this.chooseHouseId,
		  		query: this.$route.query.callPhone
		  	}
  			this.chooseHouseClienteleMesg(clientParams) 
	    },
	    submitaddcommuniForm(){//添加沟通记录-保存按钮
			let params={
				houseId: this.chooseHouseId,//房屋id----------(需要修改)
				clienteleId: this.clientID,//客户id-----------(需要修改)
				communicationTypeId: this.communicationValue,//沟通类型id-select
				desc: this.communiaddForm.desc
			}
			this.saveCommunicationRecord(params);
			this.dialogaddcommuni = false;
		},
	    handleLookcommunication(index, row){//查看沟通记录按钮
			// console.log(row);
			let params={//沟通记录id
				communicationRecordId: row.communicationRecordId
			}
			//调用查看沟通记录接口
			this.getCommunicationRecord(params);
			this.dialogaddcommunilook = true;
		},
		handleClick(tab, event){//右侧点击切换内容
			console.log(tab, event);
		},
        classObject (obj) {
			if(obj=='故障'){
				return 'equiRunRed'
			}else{
				return 'equiRunGreen'
			}
		},
//methods--end
 	},
 	watch: {//实时监控
 	 	changeClasses (){
 	 		let classesTitle = this.classesNameLabel
 	 		if(this.classesNameLabel !=classesTitle){
 	 			this.equipmentCompanyNameLabel =''
 	 			this.modelNameLabel =''
 	 		}
 	 	},
		$route(){//路由改变页面刷新
			this.phone = this.$route.query.callPhone
		},
		phone() {
			let searchHoustParams = { //进入页面根据电话进行模糊房屋的查询--gm
				query: this.$route.query.callPhone,
				page:1,
				size:99999
			}
			this.searchHouseList(searchHoustParams)
			//字典获取数据的部分---当前页面需要的字典中的内容打印:dictionaryValue
			let dictionaryValue = JSON.parse(sessionStorage.getItem('dictionaryValue'))
			//console.log(dictionaryValue)
			dictionaryValue.map((item, index) => { //获取session中的字典内容,下拉选择的文字内容提取
				if(item.typeValue == 'building_structure') { //建筑结构
					this.roomForm.buildingStructure = item.paramParamList
				}if(item.typeValue == 'heating_mode'){//供暖方式
					this.roomForm.heatingMode = item.paramParamList
				}if(item.typeValue == 'wallKeep_warm'){//外墙保暖
					this.roomForm.wallKeepWarm = item.paramParamList
				}if(item.typeValue == 'heating_terminal'){ //采暖末端
					this.roomForm.heatingTerminal = item.paramParamList
				}if(item.typeValue == 'sex'){//性别
					this.roomForm1.sex = item.paramParamList
				}if(item.typeValue == 'emergency_degree'){ //紧急程度
						this.emergencyDegreeSelect = item.paramParamList;
				}
			})
			this.getEquipmentClasses();//调用查询设备类型
			this.getXzqhInfo([1]);//调用行政区划代码接口
			//调用沟通类型查询接口（沟通类型下拉列表）
			let params1={
					query:'',
					status:0,
					size:9999,   //每页显示个数 (默认为10) 
					page:1,    //当前页数(默认为1)
				}
			this.getCommunicationTypes(params1);
			//任务类型下拉列表（调用任务类型查询接口）
			let params3={
				query: '',
				status: 0,
				page: 1,
				size: 9999
			}
			this.getTaskTypes(params3);
			//工单处理人下拉列表（调用可用业务人员查询）
			let params4={
				equipmentIds:""
			}
			this.getBusinessPersonnelList(params4);
		},
 	},
 	computed: {
		//重新返回创建时间
		gmtCreate () {
			return this.getDate(this.gmtCreateDate)
		},
		//重新返回处理时间
		gmtModified() {
			return this.getDate(this.gmtModifiedDate)
		},
		//重新遍历工单跟进记录
		recordlist () {
			return this.recordlistDate.map(v => {
				return {
					gmtCreate: this.getDate(v.gmtCreate),
					desc: v.desc,
					name: v.name,
					roleName: v.roleName
				}
			})
		},
		//重新遍历沟通记录表
	    communicationTable () {
	        return this.communicationTableDate.map(v => {
	          return {
	            gmtCreate: this.getDate(v.gmtCreate),
	            communicationRecordId: v.communicationRecordId,
	            communicationTypeId: v.communicationTypeId,
	            communicationTypeName: v.communicationTypeName,
	            desc: v.desc
	          }
	        })
		},
		//重新遍历工单信息表
		customerTable () {
	        return this.customerTableDate.map(v => {
	            return {
					gmtCreate: this.getDate(v.gmtCreate),
					emergencyDegree: v.emergencyDegree,
					emergencyDegreeName: v.emergencyDegreeName,
	            	workType: v.workType,
					workTypeName: v.workTypeName,
					workerOrderId:v.workerOrderId,
					workOrderDesc: v.workOrderDesc,
					status: v.status,
					statusName: v.statusName
	          	}
	        })
		}
    }
};
</script>
<style scoped>
  .equipment_tit{font-size:20px;padding:15px 0 10px;margin:0 20px 10px;}
  .equipment_tips{font-size:12px;color:#9f9f9f;}
  .equipment_flbox{float:left;width:300px;min-height:500px;margin:0 10px 0;border:1px solid #eee;}
  .equipment_frbox{overflow:hidden;min-height:400px;margin-right:10px;}
  .equipment_nameinp{width:300px;}
  .equipment_frtit{padding:5px 10px;}
  .equipment_tips{padding:5px 0px 5px 10px;}
  .searcop_list{padding:10px 0 10px 5px;border-bottom:1px solid #f1f1f1;cursor:pointer;}
  .equipment_serchbox{display:flex;padding:10px 5px;}
  .oncall_adrstit{height:40px;border-bottom:1px dashed #eee;font-size:16px;line-height:38px;margin-bottom:15px;}
  .tabs_box .tabs_headtit{padding-left:15px;}
  .tabs_box .el-collapse-item{margin-bottom:20px;border:0 !important;}
  .tabs_box .el-collapse{border:0 !important;}
  .el-collapse-item__wrap{border-color:#fff !important;}
  .oncall_addnew{padding:5px 5px;position:relative;z-index: 10}
  .oncall_mesgbox{max-width:640px;}
  .oncall_mesgbox .el-form-item{width:320px;float:left;}
  .oncall_mesgbox .width100{width:100% !important;height:auto;}
  .oncall_mesgbox .el-input{width:217px}
  .width100 .el-input,.width100 .el-cascader{width:100%;}
  .clearboth{clear:both;}
  /*gm查看工单gm*/
  .orderstate_tips{color:#fff;font-size:12px;padding:2px 5px;border-radius:3px;}
.ostate1{background:#FA637B;}
.order_stateline{color:#FA637B;}
.line_headtips{margin:0 10px 10px;border-bottom:1px solid #eee;}
.line_headtips span{display:block;width:100px;text-align:center;color:#01d39a;font-weight:bold;border-bottom:2px solid #01d39a;}
.line_listinput a{margin-left:20px;color:#01d39b;cursor:pointer;}
.line_listeditbox{line-height:40px;width:100%;}
.line_edittips{display:block;color:#FA637B;font-size:12px;margin-left:5px;}
.clred{color:#FA637B;padding-right:2px;font-style:normal;}

.orderrecordlist{margin-left:120px;position:relative;padding-left:30px;padding-bottom:20px;background: url("../../../static/image/flow_bg.png") no-repeat;}
.order_timetit{position:absolute;top:-5px;color:#01d39a;font-size:12px;font-weight:bold;}
.order_persontit{padding-top:20px;}
.order_recordtit{padding:10px 0;font-weight:bold;}
.oncallmesgbox{float:right;font-size:14px;}
.oncallmesgbox a{margin-left:20px;color:#409EFF;}
.oncall_equimesg .el-select,.oncall_equimesg .el-input{width:400px;}
/*el-checkbox-group折行对不齐的问题---------吴珊珊---------------*/
.el-checkbox+.el-checkbox {margin-left: 0px;}
.el-checkbox {margin-right: 25px;margin-bottom:10px;white-space: normal !important;display: flex;align-items:center;}

.oncall_tips{margin:-25px 0;color:red;line-height:28px;}
.el-form-item{height:40px;}
/*gm-设备运行-gm*/
.equiRunBox{width:98%;margin-bottom:20px;}
.equiRunHead{width: 100%;height:30px;background:#d4f7ef;display: flex; flex-direction: row;justify-content: space-between;align-items: center;}
.equiRunHeadText{display: flex;flex-direction:row;justify-content:flex-start;align-items:center;margin-left: 17px;}
.runDeviceli{width: 140px;height: 50px;position: relative;box-shadow: 1px 2px 8px #888888;margin-bottom:10px;margin-right:17px;}
.runDeviceUl{width:100%;display: flex;flex-direction:row;flex-wrap:wrap;padding-left:17px;}
.runImages{position: absolute;left:0;top:0;bottom:0;width:4px;height:100%;}
.equiRunRed{width: 50px;height:25px;background: rgba(216,0,0,1);line-height:25px;text-align:center;color:#fff;margin-right:10px;font-size: 9px;}
.equiRunGreen{width: 50px;height:25px;background: rgba(1,209,161,1);line-height:25px;text-align:center;color:#fff;margin-right:10px;font-size: 9px;}
.runDeviceItem{height:100%;display: flex;flex-direction:column;justify-content:center;align-items:center;}
.runDeviceHeader{font-size: 10px;color:#999999}
.runDeviceText{font-size: 18px;color: #333;font-weight:600}
.newFastOrder{font-size:12px;float:right;}
.nomesg{font-size:16px;line-height:400px;text-align:center;color:#999;}
/*--el-radio-group折行对不齐的问题--*/
.longRadio .el-radio+.el-radio {margin-left: 0px;}
.longRadio .el-radio {margin-right: 25px;margin-bottom:10px;white-space: normal !important;display: flex;align-items:center;}
</style>